Internet protocol (IP) tunnels are widely used in computer networks. Taking a typical network structure shown in FIG. 1 as an example, the network shown in FIG. 1 includes six hosts, wherein the hosts W, X, Y, and Z are all personal computers, and the hosts A and B are servers for providing functions such as bandwidth management etc. The hosts A, W and X are located within a same local area network 101. The host A is a gateway of the local area network 101 for external connection, and is connected to the Internet 103 via two leased lines L1 and L2. The leased lines L1 and L2 are provided by different Internet service providers. The host A applies different Internet protocol addresses (IP addresses) IP1 and IP2 in different leased lines L1 and L2. For convenience, the IP address is referred to as address below.
On the other hand, the hosts B, Y and Z are located within another local area network 102. The host B is a gateway of the local area network 102 for external connection, and is connected to the Internet 103 via two leased lines L3 and L4. The leased lines L3 and L4 are provided by different Internet service providers. The host B applies different addresses IP3 and IP4 in different leased lines L3 and L4.
The local area networks 101 and 102 respectively belong to two branches of a same enterprise. To properly utilize the bandwidth of the networks, a plurality of IP tunnels may be planned between the host A and the host B, and packets transmitted between the local area networks 101 and 102 may use these tunnels in turn. To be brief, the IP tunnel is referred to as tunnel below.
For example, two tunnels may be electronically built between the host A and the host B, one of the two tunnels is from the address IP1 of the host A to the address IP3 of the host B, another one is from the IP2 of the host A to the IP4 of the host B, and a packet transmitted between the two local area networks has a 50% chance to use one of the two tunnels. Assuming a file is about to be transmitted from the host W to the host Y, a first packet thereof may use the tunnel IP1-IP3. A packet (packet 1) to be transmitted from the host W to the host Y is first transmitted from the host W to the host A, the host A then transmits the packet 1 to the host B via another packet (packet 2) transmitted from the IP1 to the IP3. Thereafter, the host B receives the packet 2 and fetches the packet 1 therein, and transmits the packet 1 to the host Y. Similarly, if the packet to be transmitted from the host W to the host Y uses the tunnel IP2-IP4, the packet (packet 3) to be transmitted from the host W to the host Y is first transmitted from the host W to the host A, the host A then transmits the packet 3 to the host B via another packet (packet 4) transmitted from the IP2 to the IP4. Thereafter, the host B receives the packet 4 and fetches the packet 3 therein, and transmits the packet 3 to the host Y.
Since tunnels are widely used, operating system kernels such a Linux system has a built-in tunnel support, by which the tunnels may be set up via simple instructions.